import React from 'react';

class UserList extends React.Component {
    constructor (props) { }
  
    componentWillMount () {  }
  
    render () {
      const {userList} = this.state;
  
      return (
        <div>
          <header>
            <h1>用户列表</h1>
          </header>
  
          <main>
            <table>
              <thead>
                <tr>
                  <th>用户ID</th>
                  <th>用户名</th>
                  <th>性别</th>
                  <th>年龄</th>
                </tr>
              </thead>
  
              <tbody>
                {
                  userList.map((user) => {
                    return (
                      <tr key={user.id}>
                        <td>{user.id}</td>
                        <td>{user.name}</td>
                        <td>{user.gender}</td>
                        <td>{user.age}</td>
                      </tr>
                    );
                  })
                }
              </tbody>
            </table>
          </main>
        </div>
      );
    }
  }
  

export default UserList;
